package day20180129.designMode.four_Factory;

/**
 * Created by 14394 on 2018/1/29.
 */
//生成产品的抽象方法，具体生成交给子类负责
public abstract class Factory {

    public final Product create(String owner){
        Product p = createProduct(owner);
        registerProduct(p);
        return p;
    }

    protected abstract Product createProduct(String owner);

    protected abstract void registerProduct(Product product);
}
